package lipengfei.botaiframework.mybatisplus.extend;


import java.util.Properties;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
//import com.github.pagehelper.PageInterceptor;

import lipengfei.botaiframework.mybatisplus.extend.injector.MyLogicSqlInjector;
import lipengfei.botaiframework.mybatisplus.extend.interceptor.ExecutorQueryInterceptor;


@Configuration
public class BotaiMybatisPlusConfig {

    /** 乐观锁插件 配置 **/
    @Bean
    public OptimisticLockerInnerInterceptor optimisticLockerInterceptor() {
        return new OptimisticLockerInnerInterceptor();
    }
	
    /**
            * 自定义 SqlInjector
            * 里面包含自定义的全局方法
     */
    @Bean
    public MyLogicSqlInjector myLogicSqlInjector() {
        return new MyLogicSqlInjector();
    }
    
    
    @Bean
    public ExecutorQueryInterceptor findOneInterceptor() {
        return new ExecutorQueryInterceptor();
    }
  
    
//    @Bean
//    PageInterceptor pageInterceptor(){
//        PageInterceptor pageInterceptor = new PageInterceptor();
//        Properties properties = new Properties();
//        properties.setProperty("helperDialect", "mysql");
//        pageInterceptor.setProperties(properties);  // 由此可进入源码，
//        return pageInterceptor;
//    }
    
}
